
<!-- saved from url=(0037)http://www.ffmpeg.org/ffmpeg-doc.html -->
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<!-- Created by texi2html 1.56k from ffmpeg-doc.texi on 26 August 2010 -->

<title>FFmpeg Documentation</title>
<link rel="stylesheet" href="default.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.73.2">

</head>
<body>
<h1>FFmpeg Documentation</h1>
<p>
</p><p></p><hr><p>
</p><h1>Table of Contents</h1>
<ul>
<li><a name="TOC1" href="ffmpeg-doc.html#SEC1">1. Synopsis</a>
</li><li><a name="TOC2" href="ffmpeg-doc.html#SEC2">2. Description</a>
</li><li><a name="TOC3" href="ffmpeg-doc.html#SEC3">3. Options</a>
<ul>
<li><a name="TOC4" href="ffmpeg-doc.html#SEC4">3.1 Generic options</a>
</li><li><a name="TOC5" href="ffmpeg-doc.html#SEC5">3.2 Main options</a>
</li><li><a name="TOC6" href="ffmpeg-doc.html#SEC6">3.3 Video Options</a>
</li><li><a name="TOC7" href="ffmpeg-doc.html#SEC7">3.4 Advanced Video Options</a>
</li><li><a name="TOC8" href="ffmpeg-doc.html#SEC8">3.5 Audio Options</a>
</li><li><a name="TOC9" href="ffmpeg-doc.html#SEC9">3.6 Advanced Audio options:</a>
</li><li><a name="TOC10" href="ffmpeg-doc.html#SEC10">3.7 Subtitle options:</a>
</li><li><a name="TOC11" href="ffmpeg-doc.html#SEC11">3.8 Audio/Video grab options</a>
</li><li><a name="TOC12" href="ffmpeg-doc.html#SEC12">3.9 Advanced options</a>
</li><li><a name="TOC13" href="ffmpeg-doc.html#SEC13">3.10 Preset files</a>
</li><li><a name="TOC14" href="ffmpeg-doc.html#SEC14">3.11 FFmpeg formula evaluator</a>
</li></ul>
</li><li><a name="TOC15" href="ffmpeg-doc.html#SEC15">4. Tips</a>
</li><li><a name="TOC16" href="ffmpeg-doc.html#SEC16">5. Examples</a>
<ul>
<li><a name="TOC17" href="ffmpeg-doc.html#SEC17">5.1 Video and Audio grabbing</a>
</li><li><a name="TOC18" href="ffmpeg-doc.html#SEC18">5.2 X11 grabbing</a>
</li><li><a name="TOC19" href="ffmpeg-doc.html#SEC19">5.3 Video and Audio file format conversion</a>
</li></ul>
</li><li><a name="TOC20" href="ffmpeg-doc.html#SEC20">6. Input Devices</a>
<ul>
<li><a name="TOC21" href="ffmpeg-doc.html#SEC21">6.1 alsa</a>
</li><li><a name="TOC22" href="ffmpeg-doc.html#SEC22">6.2 bktr</a>
</li><li><a name="TOC23" href="ffmpeg-doc.html#SEC23">6.3 dv1394</a>
</li><li><a name="TOC24" href="ffmpeg-doc.html#SEC24">6.4 jack</a>
</li><li><a name="TOC25" href="ffmpeg-doc.html#SEC25">6.5 libdc1394</a>
</li><li><a name="TOC26" href="ffmpeg-doc.html#SEC26">6.6 oss</a>
</li><li><a name="TOC27" href="ffmpeg-doc.html#SEC27">6.7 video4linux and video4linux2</a>
</li><li><a name="TOC28" href="ffmpeg-doc.html#SEC28">6.8 vfwcap</a>
</li><li><a name="TOC29" href="ffmpeg-doc.html#SEC29">6.9 x11grab</a>
</li></ul>
</li><li><a name="TOC30" href="ffmpeg-doc.html#SEC30">7. Output Devices</a>
<ul>
<li><a name="TOC31" href="ffmpeg-doc.html#SEC31">7.1 alsa</a>
</li><li><a name="TOC32" href="ffmpeg-doc.html#SEC32">7.2 oss</a>
</li></ul>
</li><li><a name="TOC33" href="ffmpeg-doc.html#SEC33">8. Protocols</a>
<ul>
<li><a name="TOC34" href="ffmpeg-doc.html#SEC34">8.1 concat</a>
</li><li><a name="TOC35" href="ffmpeg-doc.html#SEC35">8.2 file</a>
</li><li><a name="TOC36" href="ffmpeg-doc.html#SEC36">8.3 gopher</a>
</li><li><a name="TOC37" href="ffmpeg-doc.html#SEC37">8.4 http</a>
</li><li><a name="TOC38" href="ffmpeg-doc.html#SEC38">8.5 mmst</a>
</li><li><a name="TOC39" href="ffmpeg-doc.html#SEC39">8.6 mmsh</a>
</li><li><a name="TOC40" href="ffmpeg-doc.html#SEC40">8.7 md5</a>
</li><li><a name="TOC41" href="ffmpeg-doc.html#SEC41">8.8 pipe</a>
</li><li><a name="TOC42" href="ffmpeg-doc.html#SEC42">8.9 rtmp</a>
</li><li><a name="TOC43" href="ffmpeg-doc.html#SEC43">8.10 rtmp, rtmpe, rtmps, rtmpt, rtmpte</a>
</li><li><a name="TOC44" href="ffmpeg-doc.html#SEC44">8.11 rtp</a>
</li><li><a name="TOC45" href="ffmpeg-doc.html#SEC45">8.12 tcp</a>
</li><li><a name="TOC46" href="ffmpeg-doc.html#SEC46">8.13 udp</a>
</li></ul>
</li><li><a name="TOC47" href="ffmpeg-doc.html#SEC47">9. Audio Filters</a>
<ul>
<li><a name="TOC48" href="ffmpeg-doc.html#SEC48">9.1 anull</a>
</li></ul>
</li><li><a name="TOC49" href="ffmpeg-doc.html#SEC49">10. Video Filters</a>
<ul>
<li><a name="TOC50" href="ffmpeg-doc.html#SEC50">10.1 crop</a>
</li><li><a name="TOC51" href="ffmpeg-doc.html#SEC51">10.2 fifo</a>
</li><li><a name="TOC52" href="ffmpeg-doc.html#SEC52">10.3 format</a>
</li><li><a name="TOC53" href="ffmpeg-doc.html#SEC53">10.4 hflip</a>
</li><li><a name="TOC54" href="ffmpeg-doc.html#SEC54">10.5 noformat</a>
</li><li><a name="TOC55" href="ffmpeg-doc.html#SEC55">10.6 null</a>
</li><li><a name="TOC56" href="ffmpeg-doc.html#SEC56">10.7 pad</a>
</li><li><a name="TOC57" href="ffmpeg-doc.html#SEC57">10.8 pixdesctest</a>
</li><li><a name="TOC58" href="ffmpeg-doc.html#SEC58">10.9 scale</a>
</li><li><a name="TOC59" href="ffmpeg-doc.html#SEC59">10.10 slicify</a>
</li><li><a name="TOC60" href="ffmpeg-doc.html#SEC60">10.11 unsharp</a>
</li><li><a name="TOC61" href="ffmpeg-doc.html#SEC61">10.12 vflip</a>
</li></ul>
</li><li><a name="TOC62" href="ffmpeg-doc.html#SEC62">11. Video Sources</a>
<ul>
<li><a name="TOC63" href="ffmpeg-doc.html#SEC63">11.1 buffer</a>
</li><li><a name="TOC64" href="ffmpeg-doc.html#SEC64">11.2 color</a>
</li><li><a name="TOC65" href="ffmpeg-doc.html#SEC65">11.3 nullsrc</a>
</li></ul>
</li><li><a name="TOC66" href="ffmpeg-doc.html#SEC66">12. Video Sinks</a>
<ul>
<li><a name="TOC67" href="ffmpeg-doc.html#SEC67">12.1 nullsink</a>
</li></ul>
</li></ul>
<p></p><hr><p>

</p><p>
FFmpeg Documentation




</p><h1><a name="SEC1" href="ffmpeg-doc.html#TOC1">1. Synopsis</a></h1>

<p>
The generic syntax is:



</p><pre>ffmpeg [[infile options][<samp>`-i'</samp> <var>infile</var>]]... {[outfile options] <var>outfile</var>}...
</pre>



<h1><a name="SEC2" href="ffmpeg-doc.html#TOC2">2. Description</a></h1>

<p>
FFmpeg is a very fast video and audio converter. It can also grab from
a live audio/video source.


</p><p>
The command line interface is designed to be intuitive, in the sense
that FFmpeg tries to figure out all parameters that can possibly be
derived automatically. You usually only have to specify the target
bitrate you want.


</p><p>
FFmpeg can also convert from any sample rate to any other, and resize
video on the fly with a high quality polyphase filter.


</p><p>
As a general rule, options are applied to the next specified
file. Therefore, order is important, and you can have the same
option on the command line multiple times. Each occurrence is
then applied to the next input or output file.


</p><p>
* To set the video bitrate of the output file to 64kbit/s:

</p><pre>ffmpeg -i input.avi -b 64k output.avi
</pre>

<p>
* To force the frame rate of the output file to 24 fps:

</p><pre>ffmpeg -i input.avi -r 24 output.avi
</pre>

<p>
* To force the frame rate of the input file (valid for raw formats only)
to 1 fps and the frame rate of the output file to 24 fps:

</p><pre>ffmpeg -r 1 -i input.m2v -r 24 output.avi
</pre>

<p>
The format option may be needed for raw input files.


</p><p>
By default, FFmpeg tries to convert as losslessly as possible: It
uses the same audio and video parameters for the outputs as the one
specified for the inputs.




</p><h1><a name="SEC3" href="ffmpeg-doc.html#TOC3">3. Options</a></h1>

<p>
All the numerical options, if not specified otherwise, accept in input
a string representing a number, which may contain one of the
International System number postfixes, for example 'K', 'M', 'G'.
If 'i' is appended after the postfix, powers of 2 are used instead of
powers of 10. The 'B' postfix multiplies the value for 8, and can be
appended after another postfix or used alone. This allows using for
example 'KB', 'MiB', 'G' and 'B' as postfix.


</p><p>
Options which do not take arguments are boolean options, and set the
corresponding value to true. They can be set to false by prefixing
with "no" the option name, for example using "-nofoo" in the
commandline will set to false the boolean option with name "foo".




</p><h2><a name="SEC4" href="ffmpeg-doc.html#TOC4">3.1 Generic options</a></h2>

<p>
These options are shared amongst the ff* tools.


</p><dl compact="">

<dt><samp>`-L'</samp>
</dt><dd>
Show license.

</dd><dt><samp>`-h, -?, -help, --help'</samp>
</dt><dd>
Show help.

</dd><dt><samp>`-version'</samp>
</dt><dd>
Show version.

</dd><dt><samp>`-formats'</samp>
</dt><dd>
Show available formats.

The fields preceding the format names have the following meanings:
<dl compact="">

<dt><samp>`D'</samp>
</dt><dd>
Decoding available
</dd><dt><samp>`E'</samp>
</dt><dd>
Encoding available
</dd></dl>

</dd><dt><samp>`-codecs'</samp>
</dt><dd>
Show available codecs.

The fields preceding the codec names have the following meanings:
<dl compact="">

<dt><samp>`D'</samp>
</dt><dd>
Decoding available
</dd><dt><samp>`E'</samp>
</dt><dd>
Encoding available
</dd><dt><samp>`V/A/S'</samp>
</dt><dd>
Video/audio/subtitle codec
</dd><dt><samp>`S'</samp>
</dt><dd>
Codec supports slices
</dd><dt><samp>`D'</samp>
</dt><dd>
Codec supports direct rendering
</dd><dt><samp>`T'</samp>
</dt><dd>
Codec can handle input truncated at random locations instead of only at frame boundaries
</dd></dl>

</dd><dt><samp>`-bsfs'</samp>
</dt><dd>
Show available bitstream filters.

</dd><dt><samp>`-protocols'</samp>
</dt><dd>
Show available protocols.

</dd><dt><samp>`-filters'</samp>
</dt><dd>
Show available libavfilter filters.

</dd><dt><samp>`-pix_fmts'</samp>
</dt><dd>
Show available pixel formats.

</dd><dt><samp>`-loglevel <var>loglevel</var>'</samp>
</dt><dd>
Set the logging level used by the library.
<var>loglevel</var> is a number or a string containing one of the following values:
<dl compact="">

<dt><samp>`quiet'</samp>
</dt><dd>
</dd><dt><samp>`panic'</samp>
</dt><dd>
</dd><dt><samp>`fatal'</samp>
</dt><dd>
</dd><dt><samp>`error'</samp>
</dt><dd>
</dd><dt><samp>`warning'</samp>
</dt><dd>
</dd><dt><samp>`info'</samp>
</dt><dd>
</dd><dt><samp>`verbose'</samp>
</dt><dd>
</dd><dt><samp>`debug'</samp>
</dt><dd>
</dd></dl>

By default the program logs to stderr, if coloring is supported by the
terminal, colors are used to mark errors and warnings. Log coloring
can be disabled setting the environment variable @env{NO_COLOR}.

</dd></dl>



<h2><a name="SEC5" href="ffmpeg-doc.html#TOC5">3.2 Main options</a></h2>

<dl compact="">

<dt><samp>`-f <var>fmt</var>'</samp>
</dt><dd>
Force format.

</dd><dt><samp>`-i <var>filename</var>'</samp>
</dt><dd>
input file name

</dd><dt><samp>`-y'</samp>
</dt><dd>
Overwrite output files.

</dd><dt><samp>`-t <var>duration</var>'</samp>
</dt><dd>
Restrict the transcoded/captured video sequence
to the duration specified in seconds.
<code>hh:mm:ss[.xxx]</code> syntax is also supported.

</dd><dt><samp>`-fs <var>limit_size</var>'</samp>
</dt><dd>
Set the file size limit.

</dd><dt><samp>`-ss <var>position</var>'</samp>
</dt><dd>
Seek to given time position in seconds.
<code>hh:mm:ss[.xxx]</code> syntax is also supported.

</dd><dt><samp>`-itsoffset <var>offset</var>'</samp>
</dt><dd>
Set the input time offset in seconds.
<code>[-]hh:mm:ss[.xxx]</code> syntax is also supported.
This option affects all the input files that follow it.
The offset is added to the timestamps of the input files.
Specifying a positive offset means that the corresponding
streams are delayed by 'offset' seconds.

</dd><dt><samp>`-timestamp <var>time</var>'</samp>
</dt><dd>
Set the recording timestamp in the container.
The syntax for <var>time</var> is:

<pre>now|([(YYYY-MM-DD|YYYYMMDD)[T|t| ]]((HH[:MM[:SS[.m...]]])|(HH[MM[SS[.m...]]]))[Z|z])
</pre>

If the value is "now" it takes the current time.
Time is local time unless 'Z' or 'z' is appended, in which case it is
interpreted as UTC.
If the year-month-day part is not specified it takes the current
year-month-day.

</dd><dt><samp>`-metadata <var>key</var>=<var>value</var>'</samp>
</dt><dd>
Set a metadata key/value pair.

For example, for setting the title in the output file:

<pre>ffmpeg -i in.avi -metadata title="my title" out.flv
</pre>

</dd><dt><samp>`-v <var>number</var>'</samp>
</dt><dd>
Set the logging verbosity level.

</dd><dt><samp>`-target <var>type</var>'</samp>
</dt><dd>
Specify target file type ("vcd", "svcd", "dvd", "dv", "dv50", "pal-vcd",
"ntsc-svcd", ... ). All the format options (bitrate, codecs,
buffer sizes) are then set automatically. You can just type:


<pre>ffmpeg -i myfile.avi -target vcd /tmp/vcd.mpg
</pre>

Nevertheless you can specify additional options as long as you know
they do not conflict with the standard, as in:


<pre>ffmpeg -i myfile.avi -target vcd -bf 2 /tmp/vcd.mpg
</pre>

</dd><dt><samp>`-dframes <var>number</var>'</samp>
</dt><dd>
Set the number of data frames to record.

</dd><dt><samp>`-scodec <var>codec</var>'</samp>
</dt><dd>
Force subtitle codec ('copy' to copy stream).

</dd><dt><samp>`-newsubtitle'</samp>
</dt><dd>
Add a new subtitle stream to the current output stream.

</dd><dt><samp>`-slang <var>code</var>'</samp>
</dt><dd>
Set the ISO 639 language code (3 letters) of the current subtitle stream.

</dd></dl>



<h2><a name="SEC6" href="ffmpeg-doc.html#TOC6">3.3 Video Options</a></h2>

<dl compact="">

<dt><samp>`-b <var>bitrate</var>'</samp>
</dt><dd>
Set the video bitrate in bit/s (default = 200 kb/s).
</dd><dt><samp>`-vframes <var>number</var>'</samp>
</dt><dd>
Set the number of video frames to record.
</dd><dt><samp>`-r <var>fps</var>'</samp>
</dt><dd>
Set frame rate (Hz value, fraction or abbreviation), (default = 25).
</dd><dt><samp>`-s <var>size</var>'</samp>
</dt><dd>
Set frame size. The format is <samp>`wxh'</samp> (ffserver default = 160x128, ffmpeg default = same as source).
The following abbreviations are recognized:
<dl compact="">

<dt><samp>`sqcif'</samp>
</dt><dd>
128x96
</dd><dt><samp>`qcif'</samp>
</dt><dd>
176x144
</dd><dt><samp>`cif'</samp>
</dt><dd>
352x288
</dd><dt><samp>`4cif'</samp>
</dt><dd>
704x576
</dd><dt><samp>`16cif'</samp>
</dt><dd>
1408x1152
</dd><dt><samp>`qqvga'</samp>
</dt><dd>
160x120
</dd><dt><samp>`qvga'</samp>
</dt><dd>
320x240
</dd><dt><samp>`vga'</samp>
</dt><dd>
640x480
</dd><dt><samp>`svga'</samp>
</dt><dd>
800x600
</dd><dt><samp>`xga'</samp>
</dt><dd>
1024x768
</dd><dt><samp>`uxga'</samp>
</dt><dd>
1600x1200
</dd><dt><samp>`qxga'</samp>
</dt><dd>
2048x1536
</dd><dt><samp>`sxga'</samp>
</dt><dd>
1280x1024
</dd><dt><samp>`qsxga'</samp>
</dt><dd>
2560x2048
</dd><dt><samp>`hsxga'</samp>
</dt><dd>
5120x4096
</dd><dt><samp>`wvga'</samp>
</dt><dd>
852x480
</dd><dt><samp>`wxga'</samp>
</dt><dd>
1366x768
</dd><dt><samp>`wsxga'</samp>
</dt><dd>
1600x1024
</dd><dt><samp>`wuxga'</samp>
</dt><dd>
1920x1200
</dd><dt><samp>`woxga'</samp>
</dt><dd>
2560x1600
</dd><dt><samp>`wqsxga'</samp>
</dt><dd>
3200x2048
</dd><dt><samp>`wquxga'</samp>
</dt><dd>
3840x2400
</dd><dt><samp>`whsxga'</samp>
</dt><dd>
6400x4096
</dd><dt><samp>`whuxga'</samp>
</dt><dd>
7680x4800
</dd><dt><samp>`cga'</samp>
</dt><dd>
320x200
</dd><dt><samp>`ega'</samp>
</dt><dd>
640x350
</dd><dt><samp>`hd480'</samp>
</dt><dd>
852x480
</dd><dt><samp>`hd720'</samp>
</dt><dd>
1280x720
</dd><dt><samp>`hd1080'</samp>
</dt><dd>
1920x1080
</dd></dl>

</dd><dt><samp>`-aspect <var>aspect</var>'</samp>
</dt><dd>
Set aspect ratio (4:3, 16:9 or 1.3333, 1.7777).
</dd><dt><samp>`-croptop <var>size</var> (deprecated - use -vf crop=x:y:width:height instead)'</samp>
</dt><dd>
Set top crop band size (in pixels).
</dd><dt><samp>`-cropbottom <var>size</var> (deprecated - use -vf crop=x:y:width:height instead)'</samp>
</dt><dd>
Set bottom crop band size (in pixels).
</dd><dt><samp>`-cropleft <var>size</var> (deprecated - use -vf crop=x:y:width:height instead)'</samp>
</dt><dd>
Set left crop band size (in pixels).
</dd><dt><samp>`-cropright <var>size</var> (deprecated - use -vf crop=x:y:width:height instead)'</samp>
</dt><dd>
Set right crop band size (in pixels).
</dd><dt><samp>`-padtop <var>size</var>'</samp>
</dt><dd>
</dd><dt><samp>`-padbottom <var>size</var>'</samp>
</dt><dd>
</dd><dt><samp>`-padleft <var>size</var>'</samp>
</dt><dd>
</dd><dt><samp>`-padright <var>size</var>'</samp>
</dt><dd>
</dd><dt><samp>`-padcolor <var>hex_color</var>'</samp>
</dt><dd>
All the pad options have been removed. Use -vf
pad=width:height:x:y:color instead.
</dd><dt><samp>`-vn'</samp>
</dt><dd>
Disable video recording.
</dd><dt><samp>`-bt <var>tolerance</var>'</samp>
</dt><dd>
Set video bitrate tolerance (in bits, default 4000k).
Has a minimum value of: (target_bitrate/target_framerate).
In 1-pass mode, bitrate tolerance specifies how far ratecontrol is
willing to deviate from the target average bitrate value. This is
not related to min/max bitrate. Lowering tolerance too much has
an adverse effect on quality.
</dd><dt><samp>`-maxrate <var>bitrate</var>'</samp>
</dt><dd>
Set max video bitrate (in bit/s).
Requires -bufsize to be set.
</dd><dt><samp>`-minrate <var>bitrate</var>'</samp>
</dt><dd>
Set min video bitrate (in bit/s).
Most useful in setting up a CBR encode:

<pre>ffmpeg -i myfile.avi -b 4000k -minrate 4000k -maxrate 4000k -bufsize 1835k out.m2v
</pre>

It is of little use elsewise.
</dd><dt><samp>`-bufsize <var>size</var>'</samp>
</dt><dd>
Set video buffer verifier buffer size (in bits).
</dd><dt><samp>`-vcodec <var>codec</var>'</samp>
</dt><dd>
Force video codec to <var>codec</var>. Use the <code>copy</code> special value to
tell that the raw codec data must be copied as is.
</dd><dt><samp>`-sameq'</samp>
</dt><dd>
Use same video quality as source (implies VBR).

</dd><dt><samp>`-pass <var>n</var>'</samp>
</dt><dd>
Select the pass number (1 or 2). It is used to do two-pass
video encoding. The statistics of the video are recorded in the first
pass into a log file (see also the option -passlogfile),
and in the second pass that log file is used to generate the video
at the exact requested bitrate.
On pass 1, you may just deactivate audio and set output to null,
examples for Windows and Unix:

<pre>ffmpeg -i foo.mov -vcodec libxvid -pass 1 -an -f rawvideo -y NUL
ffmpeg -i foo.mov -vcodec libxvid -pass 1 -an -f rawvideo -y /dev/null
</pre>

</dd><dt><samp>`-passlogfile <var>prefix</var>'</samp>
</dt><dd>
Set two-pass log file name prefix to <var>prefix</var>, the default file name
prefix is "ffmpeg2pass". The complete file name will be
<tt>`PREFIX-N.log'</tt>, where N is a number specific to the output
stream.

</dd><dt><samp>`-newvideo'</samp>
</dt><dd>
Add a new video stream to the current output stream.

</dd><dt><samp>`-vlang <var>code</var>'</samp>
</dt><dd>
Set the ISO 639 language code (3 letters) of the current video stream.

</dd><dt><samp>`-vf <var>filter_graph</var>'</samp>
</dt><dd>
<var>filter_graph</var> is a description of the filter graph to apply to
the input video.
Use the option "-filters" to show all the available filters (including
also sources and sinks).

</dd></dl>



<h2><a name="SEC7" href="ffmpeg-doc.html#TOC7">3.4 Advanced Video Options</a></h2>

<dl compact="">

<dt><samp>`-pix_fmt <var>format</var>'</samp>
</dt><dd>
Set pixel format. Use 'list' as parameter to show all the supported
pixel formats.
</dd><dt><samp>`-sws_flags <var>flags</var>'</samp>
</dt><dd>
Set SwScaler flags.
</dd><dt><samp>`-g <var>gop_size</var>'</samp>
</dt><dd>
Set the group of pictures size.
</dd><dt><samp>`-intra'</samp>
</dt><dd>
Use only intra frames.
</dd><dt><samp>`-vdt <var>n</var>'</samp>
</dt><dd>
Discard threshold.
</dd><dt><samp>`-qscale <var>q</var>'</samp>
</dt><dd>
Use fixed video quantizer scale (VBR).
</dd><dt><samp>`-qmin <var>q</var>'</samp>
</dt><dd>
minimum video quantizer scale (VBR)
</dd><dt><samp>`-qmax <var>q</var>'</samp>
</dt><dd>
maximum video quantizer scale (VBR)
</dd><dt><samp>`-qdiff <var>q</var>'</samp>
</dt><dd>
maximum difference between the quantizer scales (VBR)
</dd><dt><samp>`-qblur <var>blur</var>'</samp>
</dt><dd>
video quantizer scale blur (VBR) (range 0.0 - 1.0)
</dd><dt><samp>`-qcomp <var>compression</var>'</samp>
</dt><dd>
video quantizer scale compression (VBR) (default 0.5).
Constant of ratecontrol equation. Recommended range for default rc_eq: 0.0-1.0

</dd><dt><samp>`-lmin <var>lambda</var>'</samp>
</dt><dd>
minimum video lagrange factor (VBR)
</dd><dt><samp>`-lmax <var>lambda</var>'</samp>
</dt><dd>
max video lagrange factor (VBR)
</dd><dt><samp>`-mblmin <var>lambda</var>'</samp>
</dt><dd>
minimum macroblock quantizer scale (VBR)
</dd><dt><samp>`-mblmax <var>lambda</var>'</samp>
</dt><dd>
maximum macroblock quantizer scale (VBR)

These four options (lmin, lmax, mblmin, mblmax) use 'lambda' units,
but you may use the QP2LAMBDA constant to easily convert from 'q' units:

<pre>ffmpeg -i src.ext -lmax 21*QP2LAMBDA dst.ext
</pre>

</dd><dt><samp>`-rc_init_cplx <var>complexity</var>'</samp>
</dt><dd>
initial complexity for single pass encoding
</dd><dt><samp>`-b_qfactor <var>factor</var>'</samp>
</dt><dd>
qp factor between P- and B-frames
</dd><dt><samp>`-i_qfactor <var>factor</var>'</samp>
</dt><dd>
qp factor between P- and I-frames
</dd><dt><samp>`-b_qoffset <var>offset</var>'</samp>
</dt><dd>
qp offset between P- and B-frames
</dd><dt><samp>`-i_qoffset <var>offset</var>'</samp>
</dt><dd>
qp offset between P- and I-frames
</dd><dt><samp>`-rc_eq <var>equation</var>'</samp>
</dt><dd>
Set rate control equation (@xref{FFmpeg formula evaluator}) (default = <code>tex^qComp</code>).
</dd><dt><samp>`-rc_override <var>override</var>'</samp>
</dt><dd>
rate control override for specific intervals
</dd><dt><samp>`-me_method <var>method</var>'</samp>
</dt><dd>
Set motion estimation method to <var>method</var>.
Available methods are (from lowest to best quality):
<dl compact="">

<dt><samp>`zero'</samp>
</dt><dd>
Try just the (0, 0) vector.
</dd><dt><samp>`phods'</samp>
</dt><dd>
</dd><dt><samp>`log'</samp>
</dt><dd>
</dd><dt><samp>`x1'</samp>
</dt><dd>
</dd><dt><samp>`hex'</samp>
</dt><dd>
</dd><dt><samp>`umh'</samp>
</dt><dd>
</dd><dt><samp>`epzs'</samp>
</dt><dd>
(default method)
</dd><dt><samp>`full'</samp>
</dt><dd>
exhaustive search (slow and marginally better than epzs)
</dd></dl>

</dd><dt><samp>`-dct_algo <var>algo</var>'</samp>
</dt><dd>
Set DCT algorithm to <var>algo</var>. Available values are:
<dl compact="">

<dt><samp>`0'</samp>
</dt><dd>
FF_DCT_AUTO (default)
</dd><dt><samp>`1'</samp>
</dt><dd>
FF_DCT_FASTINT
</dd><dt><samp>`2'</samp>
</dt><dd>
FF_DCT_INT
</dd><dt><samp>`3'</samp>
</dt><dd>
FF_DCT_MMX
</dd><dt><samp>`4'</samp>
</dt><dd>
FF_DCT_MLIB
</dd><dt><samp>`5'</samp>
</dt><dd>
FF_DCT_ALTIVEC
</dd></dl>

</dd><dt><samp>`-idct_algo <var>algo</var>'</samp>
</dt><dd>
Set IDCT algorithm to <var>algo</var>. Available values are:
<dl compact="">

<dt><samp>`0'</samp>
</dt><dd>
FF_IDCT_AUTO (default)
</dd><dt><samp>`1'</samp>
</dt><dd>
FF_IDCT_INT
</dd><dt><samp>`2'</samp>
</dt><dd>
FF_IDCT_SIMPLE
</dd><dt><samp>`3'</samp>
</dt><dd>
FF_IDCT_SIMPLEMMX
</dd><dt><samp>`4'</samp>
</dt><dd>
FF_IDCT_LIBMPEG2MMX
</dd><dt><samp>`5'</samp>
</dt><dd>
FF_IDCT_PS2
</dd><dt><samp>`6'</samp>
</dt><dd>
FF_IDCT_MLIB
</dd><dt><samp>`7'</samp>
</dt><dd>
FF_IDCT_ARM
</dd><dt><samp>`8'</samp>
</dt><dd>
FF_IDCT_ALTIVEC
</dd><dt><samp>`9'</samp>
</dt><dd>
FF_IDCT_SH4
</dd><dt><samp>`10'</samp>
</dt><dd>
FF_IDCT_SIMPLEARM
</dd></dl>

</dd><dt><samp>`-er <var>n</var>'</samp>
</dt><dd>
Set error resilience to <var>n</var>.
<dl compact="">

<dt><samp>`1'</samp>
</dt><dd>
FF_ER_CAREFUL (default)
</dd><dt><samp>`2'</samp>
</dt><dd>
FF_ER_COMPLIANT
</dd><dt><samp>`3'</samp>
</dt><dd>
FF_ER_AGGRESSIVE
</dd><dt><samp>`4'</samp>
</dt><dd>
FF_ER_VERY_AGGRESSIVE
</dd></dl>

</dd><dt><samp>`-ec <var>bit_mask</var>'</samp>
</dt><dd>
Set error concealment to <var>bit_mask</var>. <var>bit_mask</var> is a bit mask of
the following values:
<dl compact="">

<dt><samp>`1'</samp>
</dt><dd>
FF_EC_GUESS_MVS (default = enabled)
</dd><dt><samp>`2'</samp>
</dt><dd>
FF_EC_DEBLOCK (default = enabled)
</dd></dl>

</dd><dt><samp>`-bf <var>frames</var>'</samp>
</dt><dd>
Use 'frames' B-frames (supported for MPEG-1, MPEG-2 and MPEG-4).
</dd><dt><samp>`-mbd <var>mode</var>'</samp>
</dt><dd>
macroblock decision
<dl compact="">

<dt><samp>`0'</samp>
</dt><dd>
FF_MB_DECISION_SIMPLE: Use mb_cmp (cannot change it yet in FFmpeg).
</dd><dt><samp>`1'</samp>
</dt><dd>
FF_MB_DECISION_BITS: Choose the one which needs the fewest bits.
</dd><dt><samp>`2'</samp>
</dt><dd>
FF_MB_DECISION_RD: rate distortion
</dd></dl>

</dd><dt><samp>`-4mv'</samp>
</dt><dd>
Use four motion vector by macroblock (MPEG-4 only).
</dd><dt><samp>`-part'</samp>
</dt><dd>
Use data partitioning (MPEG-4 only).
</dd><dt><samp>`-bug <var>param</var>'</samp>
</dt><dd>
Work around encoder bugs that are not auto-detected.
</dd><dt><samp>`-strict <var>strictness</var>'</samp>
</dt><dd>
How strictly to follow the standards.
</dd><dt><samp>`-aic'</samp>
</dt><dd>
Enable Advanced intra coding (h263+).
</dd><dt><samp>`-umv'</samp>
</dt><dd>
Enable Unlimited Motion Vector (h263+)

</dd><dt><samp>`-deinterlace'</samp>
</dt><dd>
Deinterlace pictures.
</dd><dt><samp>`-ilme'</samp>
</dt><dd>
Force interlacing support in encoder (MPEG-2 and MPEG-4 only).
Use this option if your input file is interlaced and you want
to keep the interlaced format for minimum losses.
The alternative is to deinterlace the input stream with
<samp>`-deinterlace'</samp>, but deinterlacing introduces losses.
</dd><dt><samp>`-psnr'</samp>
</dt><dd>
Calculate PSNR of compressed frames.
</dd><dt><samp>`-vstats'</samp>
</dt><dd>
Dump video coding statistics to <tt>`vstats_HHMMSS.log'</tt>.
</dd><dt><samp>`-vstats_file <var>file</var>'</samp>
</dt><dd>
Dump video coding statistics to <var>file</var>.
</dd><dt><samp>`-top <var>n</var>'</samp>
</dt><dd>
top=1/bottom=0/auto=-1 field first
</dd><dt><samp>`-dc <var>precision</var>'</samp>
</dt><dd>
Intra_dc_precision.
</dd><dt><samp>`-vtag <var>fourcc/tag</var>'</samp>
</dt><dd>
Force video tag/fourcc.
</dd><dt><samp>`-qphist'</samp>
</dt><dd>
Show QP histogram.
</dd><dt><samp>`-vbsf <var>bitstream_filter</var>'</samp>
</dt><dd>
Bitstream filters available are "dump_extra", "remove_extra", "noise", "h264_mp4toannexb", "imxdump", "mjpegadump".

<pre>ffmpeg -i h264.mp4 -vcodec copy -vbsf h264_mp4toannexb -an out.h264
</pre>

</dd></dl>



<h2><a name="SEC8" href="ffmpeg-doc.html#TOC8">3.5 Audio Options</a></h2>

<dl compact="">

<dt><samp>`-aframes <var>number</var>'</samp>
</dt><dd>
Set the number of audio frames to record.
</dd><dt><samp>`-ar <var>freq</var>'</samp>
</dt><dd>
Set the audio sampling frequency (default = 44100 Hz).
</dd><dt><samp>`-ab <var>bitrate</var>'</samp>
</dt><dd>
Set the audio bitrate in bit/s (default = 64k).
</dd><dt><samp>`-aq <var>q</var>'</samp>
</dt><dd>
Set the audio quality (codec-specific, VBR).
</dd><dt><samp>`-ac <var>channels</var>'</samp>
</dt><dd>
Set the number of audio channels. For input streams it is set by
default to 1, for output streams it is set by default to the same
number of audio channels in input. If the input file has audio streams
with different channel count, the behaviour is undefined.
</dd><dt><samp>`-an'</samp>
</dt><dd>
Disable audio recording.
</dd><dt><samp>`-acodec <var>codec</var>'</samp>
</dt><dd>
Force audio codec to <var>codec</var>. Use the <code>copy</code> special value to
specify that the raw codec data must be copied as is.
</dd><dt><samp>`-newaudio'</samp>
</dt><dd>
Add a new audio track to the output file. If you want to specify parameters,
do so before <code>-newaudio</code> (<code>-acodec</code>, <code>-ab</code>, etc..).

Mapping will be done automatically, if the number of output streams is equal to
the number of input streams, else it will pick the first one that matches. You
can override the mapping using <code>-map</code> as usual.

Example:

<pre>ffmpeg -i file.mpg -vcodec copy -acodec ac3 -ab 384k test.mpg -acodec mp2 -ab 192k -newaudio
</pre>

</dd><dt><samp>`-alang <var>code</var>'</samp>
</dt><dd>
Set the ISO 639 language code (3 letters) of the current audio stream.
</dd></dl>



<h2><a name="SEC9" href="ffmpeg-doc.html#TOC9">3.6 Advanced Audio options:</a></h2>

<dl compact="">

<dt><samp>`-atag <var>fourcc/tag</var>'</samp>
</dt><dd>
Force audio tag/fourcc.
</dd><dt><samp>`-absf <var>bitstream_filter</var>'</samp>
</dt><dd>
Bitstream filters available are "dump_extra", "remove_extra", "noise", "mp3comp", "mp3decomp".
</dd></dl>



<h2><a name="SEC10" href="ffmpeg-doc.html#TOC10">3.7 Subtitle options:</a></h2>

<dl compact="">

<dt><samp>`-scodec <var>codec</var>'</samp>
</dt><dd>
Force subtitle codec ('copy' to copy stream).
</dd><dt><samp>`-newsubtitle'</samp>
</dt><dd>
Add a new subtitle stream to the current output stream.
</dd><dt><samp>`-slang <var>code</var>'</samp>
</dt><dd>
Set the ISO 639 language code (3 letters) of the current subtitle stream.
</dd><dt><samp>`-sn'</samp>
</dt><dd>
Disable subtitle recording.
</dd><dt><samp>`-sbsf <var>bitstream_filter</var>'</samp>
</dt><dd>
Bitstream filters available are "mov2textsub", "text2movsub".

<pre>ffmpeg -i file.mov -an -vn -sbsf mov2textsub -scodec copy -f rawvideo sub.txt
</pre>

</dd></dl>



<h2><a name="SEC11" href="ffmpeg-doc.html#TOC11">3.8 Audio/Video grab options</a></h2>

<dl compact="">

<dt><samp>`-vc <var>channel</var>'</samp>
</dt><dd>
Set video grab channel (DV1394 only).
</dd><dt><samp>`-tvstd <var>standard</var>'</samp>
</dt><dd>
Set television standard (NTSC, PAL (SECAM)).
</dd><dt><samp>`-isync'</samp>
</dt><dd>
Synchronize read on input.
</dd></dl>



<h2><a name="SEC12" href="ffmpeg-doc.html#TOC12">3.9 Advanced options</a></h2>

<dl compact="">

<dt><samp>`-map <var>input_stream_id</var>[:<var>sync_stream_id</var>]'</samp>
</dt><dd>
Set stream mapping from input streams to output streams.
Just enumerate the input streams in the order you want them in the output.
<var>sync_stream_id</var> if specified sets the input stream to sync
against.
</dd><dt><samp>`-map_meta_data <var>outfile</var>:<var>infile</var>'</samp>
</dt><dd>
Set meta data information of <var>outfile</var> from <var>infile</var>.
</dd><dt><samp>`-debug'</samp>
</dt><dd>
Print specific debug info.
</dd><dt><samp>`-benchmark'</samp>
</dt><dd>
Show benchmarking information at the end of an encode.
Shows CPU time used and maximum memory consumption.
Maximum memory consumption is not supported on all systems,
it will usually display as 0 if not supported.
</dd><dt><samp>`-dump'</samp>
</dt><dd>
Dump each input packet.
</dd><dt><samp>`-hex'</samp>
</dt><dd>
When dumping packets, also dump the payload.
</dd><dt><samp>`-bitexact'</samp>
</dt><dd>
Only use bit exact algorithms (for codec testing).
</dd><dt><samp>`-ps <var>size</var>'</samp>
</dt><dd>
Set RTP payload size in bytes.
</dd><dt><samp>`-re'</samp>
</dt><dd>
Read input at native frame rate. Mainly used to simulate a grab device.
</dd><dt><samp>`-loop_input'</samp>
</dt><dd>
Loop over the input stream. Currently it works only for image
streams. This option is used for automatic FFserver testing.
</dd><dt><samp>`-loop_output <var>number_of_times</var>'</samp>
</dt><dd>
Repeatedly loop output for formats that support looping such as animated GIF
(0 will loop the output infinitely).
</dd><dt><samp>`-threads <var>count</var>'</samp>
</dt><dd>
Thread count.
</dd><dt><samp>`-vsync <var>parameter</var>'</samp>
</dt><dd>
Video sync method.
0   Each frame is passed with its timestamp from the demuxer to the muxer
1   Frames will be duplicated and dropped to achieve exactly the requested
    constant framerate.
2   Frames are passed through with their timestamp or dropped so as to prevent
    2 frames from having the same timestamp
-1  Chooses between 1 and 2 depending on muxer capabilities. This is the default method.

With -map you can select from
which stream the timestamps should be taken. You can leave either video or
audio unchanged and sync the remaining stream(s) to the unchanged one.
</dd><dt><samp>`-async <var>samples_per_second</var>'</samp>
</dt><dd>
Audio sync method. "Stretches/squeezes" the audio stream to match the timestamps,
the parameter is the maximum samples per second by which the audio is changed.
-async 1 is a special case where only the start of the audio stream is corrected
without any later correction.
</dd><dt><samp>`-copyts'</samp>
</dt><dd>
Copy timestamps from input to output.
</dd><dt><samp>`-shortest'</samp>
</dt><dd>
Finish encoding when the shortest input stream ends.
</dd><dt><samp>`-dts_delta_threshold'</samp>
</dt><dd>
Timestamp discontinuity delta threshold.
</dd><dt><samp>`-muxdelay <var>seconds</var>'</samp>
</dt><dd>
Set the maximum demux-decode delay.
</dd><dt><samp>`-muxpreload <var>seconds</var>'</samp>
</dt><dd>
Set the initial demux-decode delay.
</dd><dt><samp>`-streamid <var>output-stream-index</var>:<var>new-value</var>'</samp>
</dt><dd>
Assign a new value to a stream's stream-id field in the next output file.
All stream-id fields are reset to default for each output file.

For example, to set the stream 0 PID to 33 and the stream 1 PID to 36 for
an output mpegts file:

<pre>ffmpeg -i infile -streamid 0:33 -streamid 1:36 out.ts
</pre>

</dd></dl>



<h2><a name="SEC13" href="ffmpeg-doc.html#TOC13">3.10 Preset files</a></h2>

<p>
A preset file contains a sequence of <var>option</var>=<var>value</var> pairs,
one for each line, specifying a sequence of options which would be
awkward to specify on the command line. Lines starting with the hash
('#') character are ignored and are used to provide comments. Check
the <tt>`ffpresets'</tt> directory in the FFmpeg source tree for examples.


</p><p>
Preset files are specified with the <code>vpre</code>, <code>apre</code>,
<code>spre</code>, and <code>fpre</code> options. The <code>fpre</code> option takes the
filename of the preset instead of a preset name as input and can be
used for any kind of codec. For the <code>vpre</code>, <code>apre</code>, and
<code>spre</code> options, the options specified in a preset file are
applied to the currently selected codec of the same type as the preset
option.


</p><p>
The argument passed to the <code>vpre</code>, <code>apre</code>, and <code>spre</code>
preset options identifies the preset file to use according to the
following rules:


</p><p>
First ffmpeg searches for a file named <var>arg</var>.ffpreset in the
directories <tt>`$FFMPEG_DATADIR'</tt> (if set), and <tt>`$HOME/.ffmpeg'</tt>, and in
the datadir defined at configuration time (usually <tt>`PREFIX/share/ffmpeg'</tt>)
in that order. For example, if the argument is <code>libx264-max</code>, it will
search for the file <tt>`libx264-max.ffpreset'</tt>.


</p><p>
If no such file is found, then ffmpeg will search for a file named
<var>codec_name</var>-<var>arg</var>.ffpreset in the above-mentioned
directories, where <var>codec_name</var> is the name of the codec to which
the preset file options will be applied. For example, if you select
the video codec with <code>-vcodec libx264</code> and use <code>-vpre max</code>,
then it will search for the file <tt>`libx264-max.ffpreset'</tt>.


</p><p>
@anchor{FFmpeg formula evaluator}


</p><h2><a name="SEC14" href="ffmpeg-doc.html#TOC14">3.11 FFmpeg formula evaluator</a></h2>

<p>
When evaluating a rate control string, FFmpeg uses an internal formula
evaluator.


</p><p>
The following binary operators are available: <code>+</code>, <code>-</code>,
<code>*</code>, <code>/</code>, <code>^</code>.


</p><p>
The following unary operators are available: <code>+</code>, <code>-</code>,
<code>(...)</code>.


</p><p>
The following statements are available: <code>ld</code>, <code>st</code>,
<code>while</code>.


</p><p>
The following functions are available:
</p><dl compact="">

<dt><var>sinh(x)</var>
</dt><dd>
</dd><dt><var>cosh(x)</var>
</dt><dd>
</dd><dt><var>tanh(x)</var>
</dt><dd>
</dd><dt><var>sin(x)</var>
</dt><dd>
</dd><dt><var>cos(x)</var>
</dt><dd>
</dd><dt><var>tan(x)</var>
</dt><dd>
</dd><dt><var>atan(x)</var>
</dt><dd>
</dd><dt><var>asin(x)</var>
</dt><dd>
</dd><dt><var>acos(x)</var>
</dt><dd>
</dd><dt><var>exp(x)</var>
</dt><dd>
</dd><dt><var>log(x)</var>
</dt><dd>
</dd><dt><var>abs(x)</var>
</dt><dd>
</dd><dt><var>squish(x)</var>
</dt><dd>
</dd><dt><var>gauss(x)</var>
</dt><dd>
</dd><dt><var>mod(x, y)</var>
</dt><dd>
</dd><dt><var>max(x, y)</var>
</dt><dd>
</dd><dt><var>min(x, y)</var>
</dt><dd>
</dd><dt><var>eq(x, y)</var>
</dt><dd>
</dd><dt><var>gte(x, y)</var>
</dt><dd>
</dd><dt><var>gt(x, y)</var>
</dt><dd>
</dd><dt><var>lte(x, y)</var>
</dt><dd>
</dd><dt><var>lt(x, y)</var>
</dt><dd>
</dd><dt><var>bits2qp(bits)</var>
</dt><dd>
</dd><dt><var>qp2bits(qp)</var>
</dt><dd>
</dd></dl>

<p>
The following constants are available:
</p><dl compact="">

<dt><var>PI</var>
</dt><dd>
</dd><dt><var>E</var>
</dt><dd>
</dd><dt><var>iTex</var>
</dt><dd>
</dd><dt><var>pTex</var>
</dt><dd>
</dd><dt><var>tex</var>
</dt><dd>
</dd><dt><var>mv</var>
</dt><dd>
</dd><dt><var>fCode</var>
</dt><dd>
</dd><dt><var>iCount</var>
</dt><dd>
</dd><dt><var>mcVar</var>
</dt><dd>
</dd><dt><var>var</var>
</dt><dd>
</dd><dt><var>isI</var>
</dt><dd>
</dd><dt><var>isP</var>
</dt><dd>
</dd><dt><var>isB</var>
</dt><dd>
</dd><dt><var>avgQP</var>
</dt><dd>
</dd><dt><var>qComp</var>
</dt><dd>
</dd><dt><var>avgIITex</var>
</dt><dd>
</dd><dt><var>avgPITex</var>
</dt><dd>
</dd><dt><var>avgPPTex</var>
</dt><dd>
</dd><dt><var>avgBPTex</var>
</dt><dd>
</dd><dt><var>avgTex</var>
</dt><dd>
</dd></dl>



<h1><a name="SEC15" href="ffmpeg-doc.html#TOC15">4. Tips</a></h1>


<ul>
<li>

For streaming at very low bitrate application, use a low frame rate
and a small GOP size. This is especially true for RealVideo where
the Linux player does not seem to be very fast, so it can miss
frames. An example is:


<pre>ffmpeg -g 3 -r 3 -t 10 -b 50k -s qcif -f rv10 /tmp/b.rm
</pre>

</li><li>

The parameter 'q' which is displayed while encoding is the current
quantizer. The value 1 indicates that a very good quality could
be achieved. The value 31 indicates the worst quality. If q=31 appears
too often, it means that the encoder cannot compress enough to meet
your bitrate. You must either increase the bitrate, decrease the
frame rate or decrease the frame size.

</li><li>

If your computer is not fast enough, you can speed up the
compression at the expense of the compression ratio. You can use
'-me zero' to speed up motion estimation, and '-intra' to disable
motion estimation completely (you have only I-frames, which means it
is about as good as JPEG compression).

</li><li>

To have very low audio bitrates, reduce the sampling frequency
(down to 22050 Hz for MPEG audio, 22050 or 11025 for AC-3).

</li><li>

To have a constant quality (but a variable bitrate), use the option
'-qscale n' when 'n' is between 1 (excellent quality) and 31 (worst
quality).

</li><li>

When converting video files, you can use the '-sameq' option which
uses the same quality factor in the encoder as in the decoder.
It allows almost lossless encoding.

</li></ul>



<h1><a name="SEC16" href="ffmpeg-doc.html#TOC16">5. Examples</a></h1>



<h2><a name="SEC17" href="ffmpeg-doc.html#TOC17">5.1 Video and Audio grabbing</a></h2>

<p>
FFmpeg can grab video and audio from devices given that you specify the input
format and device.



</p><pre>ffmpeg -f oss -i /dev/dsp -f video4linux2 -i /dev/video0 /tmp/out.mpg
</pre>

<p>
Note that you must activate the right video source and channel before
launching FFmpeg with any TV viewer such as xawtv
(<a href="http://linux.bytesex.org/xawtv/">http://linux.bytesex.org/xawtv/</a>) by Gerd Knorr. You also
have to set the audio recording levels correctly with a
standard mixer.




</p><h2><a name="SEC18" href="ffmpeg-doc.html#TOC18">5.2 X11 grabbing</a></h2>

<p>
FFmpeg can grab the X11 display.



</p><pre>ffmpeg -f x11grab -s cif -i :0.0 /tmp/out.mpg
</pre>

<p>
0.0 is display.screen number of your X11 server, same as
the DISPLAY environment variable.



</p><pre>ffmpeg -f x11grab -s cif -i :0.0+10,20 /tmp/out.mpg
</pre>

<p>
0.0 is display.screen number of your X11 server, same as the DISPLAY environment
variable. 10 is the x-offset and 20 the y-offset for the grabbing.




</p><h2><a name="SEC19" href="ffmpeg-doc.html#TOC19">5.3 Video and Audio file format conversion</a></h2>

<p>
* FFmpeg can use any supported file format and protocol as input:


</p><p>
Examples:


</p><p>
* You can use YUV files as input:



</p><pre>ffmpeg -i /tmp/test%d.Y /tmp/out.mpg
</pre>

<p>
It will use the files:

</p><pre>/tmp/test0.Y, /tmp/test0.U, /tmp/test0.V,
/tmp/test1.Y, /tmp/test1.U, /tmp/test1.V, etc...
</pre>

<p>
The Y files use twice the resolution of the U and V files. They are
raw files, without header. They can be generated by all decent video
decoders. You must specify the size of the image with the <samp>`-s'</samp> option
if FFmpeg cannot guess it.


</p><p>
* You can input from a raw YUV420P file:



</p><pre>ffmpeg -i /tmp/test.yuv /tmp/out.avi
</pre>

<p>
test.yuv is a file containing raw YUV planar data. Each frame is composed
of the Y plane followed by the U and V planes at half vertical and
horizontal resolution.


</p><p>
* You can output to a raw YUV420P file:



</p><pre>ffmpeg -i mydivx.avi hugefile.yuv
</pre>

<p>
* You can set several input files and output files:



</p><pre>ffmpeg -i /tmp/a.wav -s 640x480 -i /tmp/a.yuv /tmp/a.mpg
</pre>

<p>
Converts the audio file a.wav and the raw YUV video file a.yuv
to MPEG file a.mpg.


</p><p>
* You can also do audio and video conversions at the same time:



</p><pre>ffmpeg -i /tmp/a.wav -ar 22050 /tmp/a.mp2
</pre>

<p>
Converts a.wav to MPEG audio at 22050 Hz sample rate.


</p><p>
* You can encode to several formats at the same time and define a
mapping from input stream to output streams:



</p><pre>ffmpeg -i /tmp/a.wav -ab 64k /tmp/a.mp2 -ab 128k /tmp/b.mp2 -map 0:0 -map 0:0
</pre>

<p>
Converts a.wav to a.mp2 at 64 kbits and to b.mp2 at 128 kbits. '-map
file:index' specifies which input stream is used for each output
stream, in the order of the definition of output streams.


</p><p>
* You can transcode decrypted VOBs:



</p><pre>ffmpeg -i snatch_1.vob -f avi -vcodec mpeg4 -b 800k -g 300 -bf 2 -acodec libmp3lame -ab 128k snatch.avi
</pre>

<p>
This is a typical DVD ripping example; the input is a VOB file, the
output an AVI file with MPEG-4 video and MP3 audio. Note that in this
command we use B-frames so the MPEG-4 stream is DivX5 compatible, and
GOP size is 300 which means one intra frame every 10 seconds for 29.97fps
input video. Furthermore, the audio stream is MP3-encoded so you need
to enable LAME support by passing <code>--enable-libmp3lame</code> to configure.
The mapping is particularly useful for DVD transcoding
to get the desired audio language.


</p><p>
NOTE: To see the supported input formats, use <code>ffmpeg -formats</code>.


</p><p>
* You can extract images from a video, or create a video from many images:


</p><p>
For extracting images from a video:

</p><pre>ffmpeg -i foo.avi -r 1 -s WxH -f image2 foo-%03d.jpeg
</pre>

<p>
This will extract one video frame per second from the video and will
output them in files named <tt>`foo-001.jpeg'</tt>, <tt>`foo-002.jpeg'</tt>,
etc. Images will be rescaled to fit the new WxH values.


</p><p>
If you want to extract just a limited number of frames, you can use the
above command in combination with the -vframes or -t option, or in
combination with -ss to start extracting from a certain point in time.


</p><p>
For creating a video from many images:

</p><pre>ffmpeg -f image2 -i foo-%03d.jpeg -r 12 -s WxH foo.avi
</pre>

<p>
The syntax <code>foo-%03d.jpeg</code> specifies to use a decimal number
composed of three digits padded with zeroes to express the sequence
number. It is the same syntax supported by the C printf function, but
only formats accepting a normal integer are suitable.


</p><p>
* You can put many streams of the same type in the output:



</p><pre>ffmpeg -i test1.avi -i test2.avi -vcodec copy -acodec copy -vcodec copy -acodec copy test12.avi -newvideo -newaudio
</pre>

<p>
In addition to the first video and audio streams, the resulting
output file <tt>`test12.avi'</tt> will contain the second video
and the second audio stream found in the input streams list.


</p><p>
The <code>-newvideo</code>, <code>-newaudio</code> and <code>-newsubtitle</code>
options have to be specified immediately after the name of the output
file to which you want to add them.




</p><h1><a name="SEC20" href="ffmpeg-doc.html#TOC20">6. Input Devices</a></h1>

<p>
Input devices are configured elements in FFmpeg which allow to access
the data coming from a multimedia device attached to your system.


</p><p>
When you configure your FFmpeg build, all the supported input devices
are enabled by default. You can list all available ones using the
configure option "--list-indevs".


</p><p>
You can disable all the input devices using the configure option
"--disable-indevs", and selectively enable an input device using the
option "--enable-indev=<var>INDEV</var>", or you can disable a particular
input device using the option "--disable-indev=<var>INDEV</var>".


</p><p>
The option "-formats" of the ff* tools will display the list of
supported input devices (amongst the demuxers).


</p><p>
A description of the currently available input devices follows.




</p><h2><a name="SEC21" href="ffmpeg-doc.html#TOC21">6.1 alsa</a></h2>

<p>
ALSA (Advanced Linux Sound Architecture) input device.


</p><p>
To enable this input device during configuration you need libasound
installed on your system.


</p><p>
This device allows capturing from an ALSA device. The name of the
device to capture has to be an ALSA card identifier.


</p><p>
An ALSA identifier has the syntax:

</p><pre>hw:<var>CARD</var>[,<var>DEV</var>[,<var>SUBDEV</var>]]
</pre>

<p>
where the <var>DEV</var> and <var>SUBDEV</var> components are optional.


</p><p>
The three arguments (in order: <var>CARD</var>,<var>DEV</var>,<var>SUBDEV</var>)
specify card number or identifier, device number and subdevice number
(-1 means any).


</p><p>
To see the list of cards currently recognized by your system check the
files <tt>`/proc/asound/cards'</tt> and <tt>`/proc/asound/devices'</tt>.


</p><p>
For example to capture with <tt>`ffmpeg'</tt> from an ALSA device with
card id 0, you may run the command:

</p><pre>ffmpeg -f alsa -i hw:0 alsaout.wav
</pre>

<p>
For more information see:
<a href="http://www.alsa-project.org/alsa-doc/alsa-lib/pcm.html">http://www.alsa-project.org/alsa-doc/alsa-lib/pcm.html</a>




</p><h2><a name="SEC22" href="ffmpeg-doc.html#TOC22">6.2 bktr</a></h2>

<p>
BSD video input device.




</p><h2><a name="SEC23" href="ffmpeg-doc.html#TOC23">6.3 dv1394</a></h2>

<p>
Linux DV 1394 input device.




</p><h2><a name="SEC24" href="ffmpeg-doc.html#TOC24">6.4 jack</a></h2>

<p>
JACK input device.


</p><p>
To enable this input device during configuration you need libjack
installed on your system.


</p><p>
A JACK input device creates one or more JACK writable clients, one for
each audio channel, with name <var>client_name</var>:input_<var>N</var>, where
<var>client_name</var> is the name provided by the application, and <var>N</var>
is a number which identifies the channel.
Each writable client will send the acquired data to the FFmpeg input
device.


</p><p>
Once you have created one or more JACK readable clients, you need to
connect them to one or more JACK writable clients.


</p><p>
To connect or disconnect JACK clients you can use the
<tt>`jack_connect'</tt> and <tt>`jack_disconnect'</tt> programs, or do it
through a graphical interface, for example with <tt>`qjackctl'</tt>.


</p><p>
To list the JACK clients and their properties you can invoke the command
<tt>`jack_lsp'</tt>.


</p><p>
Follows an example which shows how to capture a JACK readable client
with <tt>`ffmpeg'</tt>.

</p><pre># Create a JACK writable client with name "ffmpeg".
$ ffmpeg -f jack -i ffmpeg -y out.wav

# Start the sample jack_metro readable client.
$ jack_metro -b 120 -d 0.2 -f 4000

# List the current JACK clients.
$ jack_lsp -c
system:capture_1
system:capture_2
system:playback_1
system:playback_2
ffmpeg:input_1
metro:120_bpm

# Connect metro to the ffmpeg writable client.
$ jack_connect metro:120_bpm ffmpeg:input_1
</pre>

<p>
For more information read:
<a href="http://jackaudio.org/">http://jackaudio.org/</a>




</p><h2><a name="SEC25" href="ffmpeg-doc.html#TOC25">6.5 libdc1394</a></h2>

<p>
IIDC1394 input device, based on libdc1394 and libraw1394.




</p><h2><a name="SEC26" href="ffmpeg-doc.html#TOC26">6.6 oss</a></h2>

<p>
Open Sound System input device.


</p><p>
The filename to provide to the input device is the device node
representing the OSS input device, and is usually set to
<tt>`/dev/dsp'</tt>.


</p><p>
For example to grab from <tt>`/dev/dsp'</tt> using <tt>`ffmpeg'</tt> use the
command:

</p><pre>ffmpeg -f oss -i /dev/dsp /tmp/oss.wav
</pre>

<p>
For more information about OSS see:
<a href="http://manuals.opensound.com/usersguide/dsp.html">http://manuals.opensound.com/usersguide/dsp.html</a>




</p><h2><a name="SEC27" href="ffmpeg-doc.html#TOC27">6.7 video4linux and video4linux2</a></h2>

<p>
Video4Linux and Video4Linux2 input video devices.


</p><p>
The name of the device to grab is a file device node, usually Linux
systems tend to automatically create such nodes when the device
(e.g. an USB webcam) is plugged into the system, and has a name of the
kind <tt>`/dev/video<var>N</var>'</tt>, where <var>N</var> is a number associated to
the device.


</p><p>
Video4Linux and Video4Linux2 devices only support a limited set of
<var>width</var>x<var>height</var> sizes and framerates. You can check which are
supported for example with the command <tt>`dov4l'</tt> for Video4Linux
devices and the command <tt>`v4l-info'</tt> for Video4Linux2 devices.


</p><p>
If the size for the device is set to 0x0, the input device will
try to autodetect the size to use.


</p><p>
Video4Linux support is deprecated since Linux 2.6.30, and will be
dropped in later versions.


</p><p>
Follow some usage examples of the video4linux devices with the ff*
tools.

</p><pre># Grab and show the input of a video4linux device.
ffplay -s 320x240 -f video4linux /dev/video0

# Grab and show the input of a video4linux2 device, autoadjust size.
ffplay -f video4linux2 /dev/video0

# Grab and record the input of a video4linux2 device, autoadjust size.
ffmpeg -f video4linux2 -i /dev/video0 out.mpeg
</pre>



<h2><a name="SEC28" href="ffmpeg-doc.html#TOC28">6.8 vfwcap</a></h2>

<p>
VfW (Video for Windows) capture input device.




</p><h2><a name="SEC29" href="ffmpeg-doc.html#TOC29">6.9 x11grab</a></h2>

<p>
X11 video input device.


</p><p>
This device allows to capture a region of an X11 display.


</p><p>
The filename passed as input has the syntax:

</p><pre>[<var>hostname</var>]:<var>display_number</var>.<var>screen_number</var>[+<var>x_offset</var>,<var>y_offset</var>]
</pre>

<p>
<var>hostname</var>:<var>display_number</var>.<var>screen_number</var> specifies the
X11 display name of the screen to grab from. <var>hostname</var> can be
ommitted, and defaults to "localhost". The environment variable
@env{DISPLAY} contains the default display name.


</p><p>
<var>x_offset</var> and <var>y_offset</var> specify the offsets of the grabbed
area with respect to the top-left border of the X11 screen. They
default to 0.


</p><p>
Check the X11 documentation (e.g. man X) for more detailed information.


</p><p>
Use the <tt>`dpyinfo'</tt> program for getting basic information about the
properties of your X11 display (e.g. grep for "name" or "dimensions").


</p><p>
For example to grab from <tt>`:0.0'</tt> using <tt>`ffmpeg'</tt>:

</p><pre>ffmpeg -f x11grab -r 25 -s cif -i :0.0 out.mpg

# Grab at position 10,20.
ffmpeg -f x11grab -25 -s cif -i :0.0+10,20 out.mpg
</pre>



<h1><a name="SEC30" href="ffmpeg-doc.html#TOC30">7. Output Devices</a></h1>

<p>
Output devices are configured elements in FFmpeg which allow to write
multimedia data to an output device attached to your system.


</p><p>
When you configure your FFmpeg build, all the supported output devices
are enabled by default. You can list all available ones using the
configure option "--list-outdevs".


</p><p>
You can disable all the output devices using the configure option
"--disable-outdevs", and selectively enable an output device using the
option "--enable-outdev=<var>OUTDEV</var>", or you can disable a particular
input device using the option "--disable-outdev=<var>OUTDEV</var>".


</p><p>
The option "-formats" of the ff* tools will display the list of
enabled output devices (amongst the muxers).


</p><p>
A description of the currently available output devices follows.




</p><h2><a name="SEC31" href="ffmpeg-doc.html#TOC31">7.1 alsa</a></h2>

<p>
ALSA (Advanced Linux Sound Architecture) output device.




</p><h2><a name="SEC32" href="ffmpeg-doc.html#TOC32">7.2 oss</a></h2>

<p>
OSS (Open Sound System) output device.




</p><h1><a name="SEC33" href="ffmpeg-doc.html#TOC33">8. Protocols</a></h1>

<p>
Protocols are configured elements in FFmpeg which allow to access
resources which require the use of a particular protocol.


</p><p>
When you configure your FFmpeg build, all the supported protocols are
enabled by default. You can list all available ones using the
configure option "--list-protocols".


</p><p>
You can disable all the protocols using the configure option
"--disable-protocols", and selectively enable a protocol using the
option "--enable-protocol=<var>PROTOCOL</var>", or you can disable a
particular protocol using the option
"--disable-protocol=<var>PROTOCOL</var>".


</p><p>
The option "-protocols" of the ff* tools will display the list of
supported protocols.


</p><p>
A description of the currently available protocols follows.




</p><h2><a name="SEC34" href="ffmpeg-doc.html#TOC34">8.1 concat</a></h2>

<p>
Physical concatenation protocol.


</p><p>
Allow to read and seek from many resource in sequence as if they were
a unique resource.


</p><p>
A URL accepted by this protocol has the syntax:

</p><pre>concat:<var>URL1</var>|<var>URL2</var>|...|<var>URLN</var>
</pre>

<p>
where <var>URL1</var>, <var>URL2</var>, ..., <var>URLN</var> are the urls of the
resource to be concatenated, each one possibly specifying a distinct
protocol.


</p><p>
For example to read a sequence of files <tt>`split1.mpeg'</tt>,
<tt>`split2.mpeg'</tt>, <tt>`split3.mpeg'</tt> with <tt>`ffplay'</tt> use the
command:

</p><pre>ffplay concat:split1.mpeg\|split2.mpeg\|split3.mpeg
</pre>

<p>
Note that you may need to escape the character "|" which is special for
many shells.




</p><h2><a name="SEC35" href="ffmpeg-doc.html#TOC35">8.2 file</a></h2>

<p>
File access protocol.


</p><p>
Allow to read from or read to a file.


</p><p>
For example to read from a file <tt>`input.mpeg'</tt> with <tt>`ffmpeg'</tt>
use the command:

</p><pre>ffmpeg -i file:input.mpeg output.mpeg
</pre>

<p>
The ff* tools default to the file protocol, that is a resource
specified with the name "FILE.mpeg" is interpreted as the URL
"file:FILE.mpeg".




</p><h2><a name="SEC36" href="ffmpeg-doc.html#TOC36">8.3 gopher</a></h2>

<p>
Gopher protocol.




</p><h2><a name="SEC37" href="ffmpeg-doc.html#TOC37">8.4 http</a></h2>

<p>
HTTP (Hyper Text Transfer Protocol).




</p><h2><a name="SEC38" href="ffmpeg-doc.html#TOC38">8.5 mmst</a></h2>

<p>
MMS (Microsoft Media Server) protocol over TCP.




</p><h2><a name="SEC39" href="ffmpeg-doc.html#TOC39">8.6 mmsh</a></h2>

<p>
MMS (Microsoft Media Server) protocol over HTTP.


</p><p>
The required syntax is:

</p><pre>mmsh://<var>server</var>[:<var>port</var>][/<var>app</var>][/<var>playpath</var>]
</pre>



<h2><a name="SEC40" href="ffmpeg-doc.html#TOC40">8.7 md5</a></h2>

<p>
MD5 output protocol.


</p><p>
Computes the MD5 hash of the data to be written, and on close writes
this to the designated output or stdout if none is specified. It can
be used to test muxers without writing an actual file.


</p><p>
Some examples follow.

</p><pre># Write the MD5 hash of the encoded AVI file to the file output.avi.md5.
ffmpeg -i input.flv -f avi -y md5:output.avi.md5

# Write the MD5 hash of the encoded AVI file to stdout.
ffmpeg -i input.flv -f avi -y md5:
</pre>

<p>
Note that some formats (typically MOV) require the output protocol to
be seekable, so they will fail with the MD5 output protocol.




</p><h2><a name="SEC41" href="ffmpeg-doc.html#TOC41">8.8 pipe</a></h2>

<p>
UNIX pipe access protocol.


</p><p>
Allow to read and write from UNIX pipes.


</p><p>
The accepted syntax is:

</p><pre>pipe:[<var>number</var>]
</pre>

<p>
<var>number</var> is the number corresponding to the file descriptor of the
pipe (e.g. 0 for stdin, 1 for stdout, 2 for stderr).  If <var>number</var>
is not specified, by default the stdout file descriptor will be used
for writing, stdin for reading.


</p><p>
For example to read from stdin with <tt>`ffmpeg'</tt>:

</p><pre>cat test.wav | ffmpeg -i pipe:0
# ...this is the same as...
cat test.wav | ffmpeg -i pipe:
</pre>

<p>
For writing to stdout with <tt>`ffmpeg'</tt>:

</p><pre>ffmpeg -i test.wav -f avi pipe:1 | cat &gt; test.avi
# ...this is the same as...
ffmpeg -i test.wav -f avi pipe: | cat &gt; test.avi
</pre>

<p>
Note that some formats (typically MOV), require the output protocol to
be seekable, so they will fail with the pipe output protocol.




</p><h2><a name="SEC42" href="ffmpeg-doc.html#TOC42">8.9 rtmp</a></h2>

<p>
Real-Time Messaging Protocol.


</p><p>
The Real-Time Messaging Protocol (RTMP) is used for streaming multime‐
dia content across a TCP/IP network.


</p><p>
The required syntax is:

</p><pre>rtmp://<var>server</var>[:<var>port</var>][/<var>app</var>][/<var>playpath</var>]
</pre>

<p>
The accepted parameters are:
</p><dl compact="">

<dt><samp>`server'</samp>
</dt><dd>
The address of the RTMP server.

</dd><dt><samp>`port'</samp>
</dt><dd>
The number of the TCP port to use (by default is 1935).

</dd><dt><samp>`app'</samp>
</dt><dd>
It is the name of the application to access. It usually corresponds to
the path where the application is installed on the RTMP server
(e.g. <tt>`/ondemand/'</tt>, <tt>`/flash/live/'</tt>, etc.).

</dd><dt><samp>`playpath'</samp>
</dt><dd>
It is the path or name of the resource to play with reference to the
application specified in <var>app</var>, may be prefixed by "mp4:".

</dd></dl>

<p>
For example to read with <tt>`ffplay'</tt> a multimedia resource named
"sample" from the application "vod" from an RTMP server "myserver":

</p><pre>ffplay rtmp://myserver/vod/sample
</pre>



<h2><a name="SEC43" href="ffmpeg-doc.html#TOC43">8.10 rtmp, rtmpe, rtmps, rtmpt, rtmpte</a></h2>

<p>
Real-Time Messaging Protocol and its variants supported through
librtmp.


</p><p>
Requires the presence of the librtmp headers and library during
configuration. You need to explicitely configure the build with
"--enable-librtmp". If enabled this will replace the native RTMP
protocol.


</p><p>
This protocol provides most client functions and a few server
functions needed to support RTMP, RTMP tunneled in HTTP (RTMPT),
encrypted RTMP (RTMPE), RTMP over SSL/TLS (RTMPS) and tunneled
variants of these encrypted types (RTMPTE, RTMPTS).


</p><p>
The required syntax is:

</p><pre><var>rtmp_proto</var>://<var>server</var>[:<var>port</var>][/<var>app</var>][/<var>playpath</var>] <var>options</var>
</pre>

<p>
where <var>rtmp_proto</var> is one of the strings "rtmp", "rtmpt", "rtmpe",
"rtmps", "rtmpte", "rtmpts" corresponding to each RTMP variant, and
<var>server</var>, <var>port</var>, <var>app</var> and <var>playpath</var> have the same
meaning as specified for the RTMP native protocol.
<var>options</var> contains a list of space-separated options of the form
<var>key</var>=<var>val</var>.


</p><p>
See the librtmp manual page (man 3 librtmp) for more information.


</p><p>
For example, to stream a file in real-time to an RTMP server using
<tt>`ffmpeg'</tt>:

</p><pre>ffmpeg -re -i myfile -f flv rtmp://myserver/live/mystream
</pre>

<p>
To play the same stream using <tt>`ffplay'</tt>:

</p><pre>ffplay "rtmp://myserver/live/mystream live=1"
</pre>



<h2><a name="SEC44" href="ffmpeg-doc.html#TOC44">8.11 rtp</a></h2>

<p>
Real-Time Protocol.




</p><h2><a name="SEC45" href="ffmpeg-doc.html#TOC45">8.12 tcp</a></h2>

<p>
Trasmission Control Protocol.




</p><h2><a name="SEC46" href="ffmpeg-doc.html#TOC46">8.13 udp</a></h2>

<p>
User Datagram Protocol.




</p><h1><a name="SEC47" href="ffmpeg-doc.html#TOC47">9. Audio Filters</a></h1>

<p>
When you configure your FFmpeg build, you can disable any of the
existing filters using --disable-filters.
The configure output will show the audio filters included in your
build.


</p><p>
Below is a description of the currently available audio filters.




</p><h2><a name="SEC48" href="ffmpeg-doc.html#TOC48">9.1 anull</a></h2>

<p>
Pass the audio source unchanged to the output.




</p><h1><a name="SEC49" href="ffmpeg-doc.html#TOC49">10. Video Filters</a></h1>

<p>
When you configure your FFmpeg build, you can disable any of the
existing filters using --disable-filters.
The configure output will show the video filters included in your
build.


</p><p>
Below is a description of the currently available video filters.




</p><h2><a name="SEC50" href="ffmpeg-doc.html#TOC50">10.1 crop</a></h2>

<p>
Crop the input video to <var>x</var>:<var>y</var>:<var>width</var>:<var>height</var>.



</p><pre>./ffmpeg -i in.avi -vf "crop=0:0:0:240" out.avi
</pre>

<p>
<var>x</var> and <var>y</var> specify the position of the top-left corner of the
output (non-cropped) area.


</p><p>
The default value of <var>x</var> and <var>y</var> is 0.


</p><p>
The <var>width</var> and <var>height</var> parameters specify the width and height
of the output (non-cropped) area.


</p><p>
A value of 0 is interpreted as the maximum possible size contained in
the area delimited by the top-left corner at position x:y.


</p><p>
For example the parameters:



</p><pre>"crop=100:100:0:0"
</pre>

<p>
will delimit the rectangle with the top-left corner placed at position
100:100 and the right-bottom corner corresponding to the right-bottom
corner of the input image.


</p><p>
The default value of <var>width</var> and <var>height</var> is 0.




</p><h2><a name="SEC51" href="ffmpeg-doc.html#TOC51">10.2 fifo</a></h2>

<p>
Buffer input images and send them when they are requested.


</p><p>
This filter is mainly useful when auto-inserted by the libavfilter
framework.


</p><p>
The filter does not take parameters.




</p><h2><a name="SEC52" href="ffmpeg-doc.html#TOC52">10.3 format</a></h2>

<p>
Convert the input video to one of the specified pixel formats.
Libavfilter will try to pick one that is supported for the input to
the next filter.


</p><p>
The filter accepts a list of pixel format names, separated by ":",
for example "yuv420p:monow:rgb24".


</p><p>
The following command:



</p><pre>./ffmpeg -i in.avi -vf "format=yuv420p" out.avi
</pre>

<p>
will convert the input video to the format "yuv420p".




</p><h2><a name="SEC53" href="ffmpeg-doc.html#TOC53">10.4 hflip</a></h2>

<p>
Flip the input video horizontally.


</p><p>
For example to horizontally flip the video in input with
<tt>`ffmpeg'</tt>:

</p><pre>ffmpeg -i in.avi -vf "hflip" out.avi
</pre>



<h2><a name="SEC54" href="ffmpeg-doc.html#TOC54">10.5 noformat</a></h2>

<p>
Force libavfilter not to use any of the specified pixel formats for the
input to the next filter.


</p><p>
The filter accepts a list of pixel format names, separated by ":",
for example "yuv420p:monow:rgb24".


</p><p>
The following command:



</p><pre>./ffmpeg -i in.avi -vf "noformat=yuv420p, vflip" out.avi
</pre>

<p>
will make libavfilter use a format different from "yuv420p" for the
input to the vflip filter.




</p><h2><a name="SEC55" href="ffmpeg-doc.html#TOC55">10.6 null</a></h2>

<p>
Pass the video source unchanged to the output.




</p><h2><a name="SEC56" href="ffmpeg-doc.html#TOC56">10.7 pad</a></h2>

<p>
Add paddings to the input image, and places the original input at the
given coordinates <var>x</var>, <var>y</var>.


</p><p>
It accepts the following parameters:
<var>width</var>:<var>height</var>:<var>x</var>:<var>y</var>:<var>color</var>.


</p><p>
Follows the description of the accepted parameters.


</p><dl compact="">

<dt><samp>`width, height'</samp>
</dt><dd>
Specify the size of the output image with the paddings added. If the
value for <var>width</var> or <var>height</var> is 0, the corresponding input size
is used for the output.

The default value of <var>width</var> and <var>height</var> is 0.

</dd><dt><samp>`x, y'</samp>
</dt><dd>
Specify the offsets where to place the input image in the padded area
with respect to the top/left border of the output image.

The default value of <var>x</var> and <var>y</var> is 0.

</dd><dt><samp>`color'</samp>
</dt><dd>
Specify the color of the padded area, it can be the name of a color
(case insensitive match) or a 0xRRGGBB[AA] sequence.

The default value of <var>color</var> is "black".

</dd></dl>



<h2><a name="SEC57" href="ffmpeg-doc.html#TOC57">10.8 pixdesctest</a></h2>

<p>
Pixel format descriptor test filter, mainly useful for internal
testing. The output video should be equal to the input video.


</p><p>
For example:

</p><pre>format=monow, pixdesctest
</pre>

<p>
can be used to test the monowhite pixel format descriptor definition.




</p><h2><a name="SEC58" href="ffmpeg-doc.html#TOC58">10.9 scale</a></h2>

<p>
Scale the input video to <var>width</var>:<var>height</var> and/or convert the image format.


</p><p>
For example the command:



</p><pre>./ffmpeg -i in.avi -vf "scale=200:100" out.avi
</pre>

<p>
will scale the input video to a size of 200x100.


</p><p>
If the input image format is different from the format requested by
the next filter, the scale filter will convert the input to the
requested format.


</p><p>
If the value for <var>width</var> or <var>height</var> is 0, the respective input
size is used for the output.


</p><p>
If the value for <var>width</var> or <var>height</var> is -1, the scale filter will
use, for the respective output size, a value that maintains the aspect
ratio of the input image.


</p><p>
The default value of <var>width</var> and <var>height</var> is 0.




</p><h2><a name="SEC59" href="ffmpeg-doc.html#TOC59">10.10 slicify</a></h2>

<p>
Pass the images of input video on to next video filter as multiple
slices.



</p><pre>./ffmpeg -i in.avi -vf "slicify=32" out.avi
</pre>

<p>
The filter accepts the slice height as parameter. If the parameter is
not specified it will use the default value of 16.


</p><p>
Adding this in the beginning of filter chains should make filtering
faster due to better use of the memory cache.




</p><h2><a name="SEC60" href="ffmpeg-doc.html#TOC60">10.11 unsharp</a></h2>

<p>
Sharpen or blur the input video.


</p><p>
It accepts the following parameters:
<var>luma_msize_x</var>:<var>luma_msize_y</var>:<var>luma_amount</var>:<var>chroma_msize_x</var>:<var>chroma_msize_y</var>:<var>chroma_amount</var>


</p><p>
Negative values for the amount will blur the input video, while positive
values will sharpen. All parameters are optional and default to the
equivalent of the string '5:5:1.0:0:0:0.0'.


</p><dl compact="">

<dt><samp>`luma_msize_x'</samp>
</dt><dd>
Set the luma matrix horizontal size. It can be an integer between 3
and 13, default value is 5.

</dd><dt><samp>`luma_msize_y'</samp>
</dt><dd>
Set the luma matrix vertical size. It can be an integer between 3
and 13, default value is 5.

</dd><dt><samp>`luma_amount'</samp>
</dt><dd>
Set the luma effect strength. It can be a float number between -2.0
and 5.0, default value is 1.0.

</dd><dt><samp>`chroma_msize_x'</samp>
</dt><dd>
Set the chroma matrix horizontal size. It can be an integer between 3
and 13, default value is 0.

</dd><dt><samp>`chroma_msize_y'</samp>
</dt><dd>
Set the chroma matrix vertical size. It can be an integer between 3
and 13, default value is 0.

</dd><dt><samp>`luma_amount'</samp>
</dt><dd>
Set the chroma effect strength. It can be a float number between -2.0
and 5.0, default value is 0.0.

</dd></dl>


<pre># Strong luma sharpen effect parameters
unsharp=7:7:2.5

# Strong blur of both luma and chroma parameters
unsharp=7:7:-2:7:7:-2

# Use the default values with <code>ffmpeg</code>
./ffmpeg -i in.avi -vf "unsharp" out.mp4
</pre>



<h2><a name="SEC61" href="ffmpeg-doc.html#TOC61">10.12 vflip</a></h2>

<p>
Flip the input video vertically.



</p><pre>./ffmpeg -i in.avi -vf "vflip" out.avi
</pre>



<h1><a name="SEC62" href="ffmpeg-doc.html#TOC62">11. Video Sources</a></h1>

<p>
Below is a description of the currently available video sources.




</p><h2><a name="SEC63" href="ffmpeg-doc.html#TOC63">11.1 buffer</a></h2>

<p>
Buffer video frames, and make them available to the filter chain.


</p><p>
This source is mainly intended for a programmatic use, in particular
through the interface defined in <tt>`libavfilter/vsrc_buffer.h'</tt>.


</p><p>
It accepts the following parameters:
<var>width</var>:<var>height</var>:<var>pix_fmt_string</var>


</p><p>
All the parameters need to be explicitely defined.


</p><p>
Follows the list of the accepted parameters.


</p><dl compact="">

<dt><samp>`width, height'</samp>
</dt><dd>
Specify the width and height of the buffered video frames.

</dd><dt><samp>`pix_fmt_string'</samp>
</dt><dd>
A string representing the pixel format of the buffered video frames.
It may be a number corresponding to a pixel format, or a pixel format
name.

</dd></dl>

<p>
For example:

</p><pre>buffer=320:240:yuv410p
</pre>

<p>
will instruct the source to accept video frames with size 320x240 and
with format "yuv410p". Since the pixel format with name "yuv410p"
corresponds to the number 6 (check the enum PixelFormat definition in
<tt>`libavutil/pixfmt.h'</tt>), this example corresponds to:

</p><pre>buffer=320:240:6
</pre>



<h2><a name="SEC64" href="ffmpeg-doc.html#TOC64">11.2 color</a></h2>

<p>
Provide an uniformly colored input.


</p><p>
It accepts the following parameters:
<var>color</var>:<var>frame_size</var>:<var>frame_rate</var>


</p><p>
Follows the description of the accepted parameters.


</p><dl compact="">

<dt><samp>`color'</samp>
</dt><dd>
Specify the color of the source. It can be the name of a color (case
insensitive match) or a 0xRRGGBB[AA] sequence, possibly followed by an
alpha specifier. The default value is "black".

</dd><dt><samp>`frame_size'</samp>
</dt><dd>
Specify the size of the sourced video, it may be a string of the form
<var>width</var>x<var>heigth</var>, or the name of a size abbreviation. The
default value is "320x240".

</dd><dt><samp>`frame_rate'</samp>
</dt><dd>
Specify the frame rate of the sourced video, as the number of frames
generated per second. It has to be a string in the format
<var>frame_rate_num</var>/<var>frame_rate_den</var>, an integer number, a float
number or a valid video frame rate abbreviation. The default value is
"25".

</dd></dl>

<p>
For example the following graph description will generate a red source
with an opacity of 0.2, with size "qcif" and a frame rate of 10
frames per second, which will be overlayed over the source connected
to the pad with identifier "in".



</p><pre>"color=red@0.2:qcif:10 [color]; [in][color] overlay [out]"
</pre>



<h2><a name="SEC65" href="ffmpeg-doc.html#TOC65">11.3 nullsrc</a></h2>

<p>
Null video source, never return images. It is mainly useful as a
template and to be employed in analysis / debugging tools.


</p><p>
It accepts as optional parameter a string of the form
<var>width</var>:<var>height</var>, where <var>width</var> and <var>height</var> specify the size of
the configured source.


</p><p>
The default values of <var>width</var> and <var>height</var> are respectively 352
and 288 (corresponding to the CIF size format).




</p><h1><a name="SEC66" href="ffmpeg-doc.html#TOC66">12. Video Sinks</a></h1>

<p>
Below is a description of the currently available video sinks.




</p><h2><a name="SEC67" href="ffmpeg-doc.html#TOC67">12.1 nullsink</a></h2>

<p>
Null video sink, do absolutely nothing with the input video. It is
mainly useful as a template and to be employed in analysis / debugging
tools.


</p><p></p><hr><p>
This document was generated on 26 August 2010 using
<a href="http://wwwinfo.cern.ch/dis/texi2html/">texi2html</a>&nbsp;1.56k.


</p></body></html>